package com.example.administrator.tenyuanpackage.speacial.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Created by yq on 2017/2/28.
 */

public class TenViewPagerAdapter extends FragmentPagerAdapter {

    private Context context;
    private ArrayList<Fragment> fragments;
    private String[] titles;

    public TenViewPagerAdapter(FragmentManager fm,Context context,ArrayList<Fragment> fragments,String[] titles) {
        super(fm);
        this.context = context;
        this.fragments = fragments;
        this.titles = titles;

    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);

    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
